Optimal. Leaf size=251 \[ \frac {3 (7 A+3 i B) x}{128 a^2 c^5}-\frac {i A-B}{128 a^2 c^5 f (i-\tan (e+f x))^2}-\frac {3 A+2 i B}{64 a^2 c^5 f (i-\tan (e+f x))}+\frac {A-i B}{40 a^2 c^5 f (i+\tan (e+f x))^5}-\frac {3 i A+B}{64 a^2 c^5 f (i+\tan (e+f x))^4}-\frac {A}{16 a^2 c^5 f (i+\tan (e+f x))^3}+\frac {5 i A-B}{64 a^2 c^5 f (i+\tan (e+f x))^2}+\frac {5 (3 A+i B)}{128 a^2 c^5 f (i+\tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.21, antiderivative size = 251, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 78, 209}
\begin {gather*} -\frac {3 A+2 i B}{64 a^2 c^5 f (-\tan (e+f x)+i)}+\frac {5 (3 A+i B)}{128 a^2 c^5 f (\tan (e+f x)+i)}-\frac {-B+i A}{128 a^2 c^5 f (-\tan (e+f x)+i)^2}+\frac {-B+5 i A}{64 a^2 c^5 f (\tan (e+f x)+i)^2}-\frac {B+3 i A}{64 a^2 c^5 f (\tan (e+f x)+i)^4}+\frac {A-i B}{40 a^2 c^5 f (\tan (e+f x)+i)^5}+\frac {3 x (7 A+3 i B)}{128 a^2 c^5}-\frac {A}{16 a^2 c^5 f (\tan (e+f x)+i)^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 209
Rule 3669
Rubi steps
\begin {align*} \int \frac {A+B \tan (e+f x)}{(a+i a \tan (e+f x))^2 (c-i c \tan (e+f x))^5} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {A+B x}{(a+i a x)^3 (c-i c x)^6} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {i (A+i B)}{64 a^3 c^6 (-i+x)^3}+\frac {-3 A-2 i B}{64 a^3 c^6 (-i+x)^2}+\frac {-A+i B}{8 a^3 c^6 (i+x)^6}+\frac {3 i A+B}{16 a^3 c^6 (i+x)^5}+\frac {3 A}{16 a^3 c^6 (i+x)^4}+\frac {-5 i A+B}{32 a^3 c^6 (i+x)^3}-\frac {5 (3 A+i B)}{128 a^3 c^6 (i+x)^2}+\frac {3 (7 A+3 i B)}{128 a^3 c^6 \left (1+x^2\right )}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i A-B}{128 a^2 c^5 f (i-\tan (e+f x))^2}-\frac {3 A+2 i B}{64 a^2 c^5 f (i-\tan (e+f x))}+\frac {A-i B}{40 a^2 c^5 f (i+\tan (e+f x))^5}-\frac {3 i A+B}{64 a^2 c^5 f (i+\tan (e+f x))^4}-\frac {A}{16 a^2 c^5 f (i+\tan (e+f x))^3}+\frac {5 i A-B}{64 a^2 c^5 f (i+\tan (e+f x))^2}+\frac {5 (3 A+i B)}{128 a^2 c^5 f (i+\tan (e+f x))}+\frac {(3 (7 A+3 i B)) \text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{128 a^2 c^5 f}\\ &=\frac {3 (7 A+3 i B) x}{128 a^2 c^5}-\frac {i A-B}{128 a^2 c^5 f (i-\tan (e+f x))^2}-\frac {3 A+2 i B}{64 a^2 c^5 f (i-\tan (e+f x))}+\frac {A-i B}{40 a^2 c^5 f (i+\tan (e+f x))^5}-\frac {3 i A+B}{64 a^2 c^5 f (i+\tan (e+f x))^4}-\frac {A}{16 a^2 c^5 f (i+\tan (e+f x))^3}+\frac {5 i A-B}{64 a^2 c^5 f (i+\tan (e+f x))^2}+\frac {5 (3 A+i B)}{128 a^2 c^5 f (i+\tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.56, size = 274, normalized size = 1.09 \begin {gather*} \frac {\sec ^2(e+f x) (\cos (5 (e+f x))+i \sin (5 (e+f x))) (50 i (21 A+i B) \cos (e+f x)+20 (A (7 i-42 f x)+3 B (1-6 i f x)) \cos (3 (e+f x))-105 i A \cos (5 (e+f x))+125 B \cos (5 (e+f x))-6 i A \cos (7 (e+f x))+14 B \cos (7 (e+f x))+350 A \sin (e+f x)+150 i B \sin (e+f x)-140 A \sin (3 (e+f x))+60 i B \sin (3 (e+f x))+840 i A f x \sin (3 (e+f x))-360 B f x \sin (3 (e+f x))-175 A \sin (5 (e+f x))-75 i B \sin (5 (e+f x))-14 A \sin (7 (e+f x))-6 i B \sin (7 (e+f x)))}{5120 a^2 c^5 f (-i+\tan (e+f x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.45, size = 190, normalized size = 0.76
method | result | size |
derivativedivides | \(\frac {-\frac {\frac {3 i A}{16}+\frac {B}{16}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {15 A}{128}-\frac {5 i B}{128}}{i+\tan \left (f x +e \right )}-\frac {-\frac {5 i A}{32}+\frac {B}{32}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}+\left (\frac {21 i A}{256}-\frac {9 B}{256}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {A}{16 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {-\frac {A}{8}+\frac {i B}{8}}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}-\frac {-\frac {B}{64}+\frac {i A}{64}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {i B}{32}-\frac {3 A}{64}}{-i+\tan \left (f x +e \right )}+\left (-\frac {21 i A}{256}+\frac {9 B}{256}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )}{f \,a^{2} c^{5}}\) | \(190\) |
default | \(\frac {-\frac {\frac {3 i A}{16}+\frac {B}{16}}{4 \left (i+\tan \left (f x +e \right )\right )^{4}}-\frac {-\frac {15 A}{128}-\frac {5 i B}{128}}{i+\tan \left (f x +e \right )}-\frac {-\frac {5 i A}{32}+\frac {B}{32}}{2 \left (i+\tan \left (f x +e \right )\right )^{2}}+\left (\frac {21 i A}{256}-\frac {9 B}{256}\right ) \ln \left (i+\tan \left (f x +e \right )\right )-\frac {A}{16 \left (i+\tan \left (f x +e \right )\right )^{3}}-\frac {-\frac {A}{8}+\frac {i B}{8}}{5 \left (i+\tan \left (f x +e \right )\right )^{5}}-\frac {-\frac {B}{64}+\frac {i A}{64}}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-\frac {i B}{32}-\frac {3 A}{64}}{-i+\tan \left (f x +e \right )}+\left (-\frac {21 i A}{256}+\frac {9 B}{256}\right ) \ln \left (-i+\tan \left (f x +e \right )\right )}{f \,a^{2} c^{5}}\) | \(190\) |
risch | \(\frac {9 i x B}{128 a^{2} c^{5}}+\frac {21 x A}{128 a^{2} c^{5}}-\frac {{\mathrm e}^{10 i \left (f x +e \right )} B}{1280 a^{2} c^{5} f}-\frac {i {\mathrm e}^{10 i \left (f x +e \right )} A}{1280 a^{2} c^{5} f}-\frac {5 \,{\mathrm e}^{8 i \left (f x +e \right )} B}{1024 a^{2} c^{5} f}-\frac {7 i {\mathrm e}^{8 i \left (f x +e \right )} A}{1024 a^{2} c^{5} f}-\frac {3 \,{\mathrm e}^{6 i \left (f x +e \right )} B}{256 a^{2} c^{5} f}-\frac {7 i {\mathrm e}^{6 i \left (f x +e \right )} A}{256 a^{2} c^{5} f}-\frac {3 \cos \left (4 f x +4 e \right ) B}{256 a^{2} c^{5} f}-\frac {17 i \cos \left (4 f x +4 e \right ) A}{256 a^{2} c^{5} f}-\frac {i \sin \left (4 f x +4 e \right ) B}{128 a^{2} c^{5} f}+\frac {9 \sin \left (4 f x +4 e \right ) A}{128 a^{2} c^{5} f}-\frac {7 i A \cos \left (2 f x +2 e \right )}{64 a^{2} c^{5} f}+\frac {5 i \sin \left (2 f x +2 e \right ) B}{128 a^{2} c^{5} f}+\frac {21 \sin \left (2 f x +2 e \right ) A}{128 a^{2} c^{5} f}\) | \(303\) |
norman | \(\frac {\frac {3 \left (3 i B +7 A \right ) x}{128 a c}-\frac {11 i A +B}{40 a c f}+\frac {\left (-9 i B +107 A \right ) \tan \left (f x +e \right )}{128 a c f}+\frac {\left (3 i B +7 A \right ) \left (\tan ^{5}\left (f x +e \right )\right )}{5 a c f}+\frac {7 \left (3 i B +7 A \right ) \left (\tan ^{7}\left (f x +e \right )\right )}{64 a c f}+\frac {3 \left (3 i B +7 A \right ) \left (\tan ^{9}\left (f x +e \right )\right )}{128 a c f}+\frac {15 \left (3 i B +7 A \right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{128 a c}+\frac {15 \left (3 i B +7 A \right ) x \left (\tan ^{4}\left (f x +e \right )\right )}{64 a c}+\frac {15 \left (3 i B +7 A \right ) x \left (\tan ^{6}\left (f x +e \right )\right )}{64 a c}+\frac {15 \left (3 i B +7 A \right ) x \left (\tan ^{8}\left (f x +e \right )\right )}{128 a c}+\frac {3 \left (3 i B +7 A \right ) x \left (\tan ^{10}\left (f x +e \right )\right )}{128 a c}+\frac {\left (43 i B +79 A \right ) \left (\tan ^{3}\left (f x +e \right )\right )}{64 a c f}+\frac {\left (i A +3 B \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{8 a c f}}{a \,c^{4} \left (1+\tan ^{2}\left (f x +e \right )\right )^{5}}\) | \(340\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.75, size = 159, normalized size = 0.63 \begin {gather*} \frac {{\left (120 \, {\left (7 \, A + 3 i \, B\right )} f x e^{\left (4 i \, f x + 4 i \, e\right )} - 4 \, {\left (i \, A + B\right )} e^{\left (14 i \, f x + 14 i \, e\right )} - 5 \, {\left (7 i \, A + 5 \, B\right )} e^{\left (12 i \, f x + 12 i \, e\right )} - 20 \, {\left (7 i \, A + 3 \, B\right )} e^{\left (10 i \, f x + 10 i \, e\right )} - 50 \, {\left (7 i \, A + B\right )} e^{\left (8 i \, f x + 8 i \, e\right )} - 100 \, {\left (7 i \, A - B\right )} e^{\left (6 i \, f x + 6 i \, e\right )} - 20 \, {\left (-7 i \, A + 5 \, B\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 10 i \, A - 10 \, B\right )} e^{\left (-4 i \, f x - 4 i \, e\right )}}{5120 \, a^{2} c^{5} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.71, size = 605, normalized size = 2.41 \begin {gather*} \begin {cases} \frac {\left (\left (11258999068426240 i A a^{12} c^{30} f^{6} e^{2 i e} - 11258999068426240 B a^{12} c^{30} f^{6} e^{2 i e}\right ) e^{- 4 i f x} + \left (157625986957967360 i A a^{12} c^{30} f^{6} e^{4 i e} - 112589990684262400 B a^{12} c^{30} f^{6} e^{4 i e}\right ) e^{- 2 i f x} + \left (- 788129934789836800 i A a^{12} c^{30} f^{6} e^{8 i e} + 112589990684262400 B a^{12} c^{30} f^{6} e^{8 i e}\right ) e^{2 i f x} + \left (- 394064967394918400 i A a^{12} c^{30} f^{6} e^{10 i e} - 56294995342131200 B a^{12} c^{30} f^{6} e^{10 i e}\right ) e^{4 i f x} + \left (- 157625986957967360 i A a^{12} c^{30} f^{6} e^{12 i e} - 67553994410557440 B a^{12} c^{30} f^{6} e^{12 i e}\right ) e^{6 i f x} + \left (- 39406496739491840 i A a^{12} c^{30} f^{6} e^{14 i e} - 28147497671065600 B a^{12} c^{30} f^{6} e^{14 i e}\right ) e^{8 i f x} + \left (- 4503599627370496 i A a^{12} c^{30} f^{6} e^{16 i e} - 4503599627370496 B a^{12} c^{30} f^{6} e^{16 i e}\right ) e^{10 i f x}\right ) e^{- 6 i e}}{5764607523034234880 a^{14} c^{35} f^{7}} & \text {for}\: a^{14} c^{35} f^{7} e^{6 i e} \neq 0 \\x \left (- \frac {21 A + 9 i B}{128 a^{2} c^{5}} + \frac {\left (A e^{14 i e} + 7 A e^{12 i e} + 21 A e^{10 i e} + 35 A e^{8 i e} + 35 A e^{6 i e} + 21 A e^{4 i e} + 7 A e^{2 i e} + A - i B e^{14 i e} - 5 i B e^{12 i e} - 9 i B e^{10 i e} - 5 i B e^{8 i e} + 5 i B e^{6 i e} + 9 i B e^{4 i e} + 5 i B e^{2 i e} + i B\right ) e^{- 4 i e}}{128 a^{2} c^{5}}\right ) & \text {otherwise} \end {cases} + \frac {x \left (21 A + 9 i B\right )}{128 a^{2} c^{5}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.97, size = 269, normalized size = 1.07 \begin {gather*} -\frac {\frac {60 \, {\left (-7 i \, A + 3 \, B\right )} \log \left (\tan \left (f x + e\right ) + i\right )}{a^{2} c^{5}} + \frac {60 \, {\left (7 i \, A - 3 \, B\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2} c^{5}} + \frac {10 \, {\left (63 i \, A \tan \left (f x + e\right )^{2} - 27 \, B \tan \left (f x + e\right )^{2} + 150 \, A \tan \left (f x + e\right ) + 70 i \, B \tan \left (f x + e\right ) - 91 i \, A + 47 \, B\right )}}{a^{2} c^{5} {\left (-i \, \tan \left (f x + e\right ) - 1\right )}^{2}} + \frac {959 i \, A \tan \left (f x + e\right )^{5} - 411 \, B \tan \left (f x + e\right )^{5} - 5395 \, A \tan \left (f x + e\right )^{4} - 2255 i \, B \tan \left (f x + e\right )^{4} - 12390 i \, A \tan \left (f x + e\right )^{3} + 4990 \, B \tan \left (f x + e\right )^{3} + 14710 \, A \tan \left (f x + e\right )^{2} + 5550 i \, B \tan \left (f x + e\right )^{2} + 9275 i \, A \tan \left (f x + e\right ) - 3015 \, B \tan \left (f x + e\right ) - 2647 \, A - 483 i \, B}{a^{2} c^{5} {\left (\tan \left (f x + e\right ) + i\right )}^{5}}}{5120 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 10.24, size = 291, normalized size = 1.16 \begin {gather*} \frac {\mathrm {tan}\left (e+f\,x\right )\,\left (-\frac {3\,B}{640\,a^2\,c^5}+\frac {A\,7{}\mathrm {i}}{640\,a^2\,c^5}\right )+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {7\,A}{32\,a^2\,c^5}+\frac {B\,3{}\mathrm {i}}{32\,a^2\,c^5}\right )-{\mathrm {tan}\left (e+f\,x\right )}^3\,\left (-\frac {9\,B}{32\,a^2\,c^5}+\frac {A\,21{}\mathrm {i}}{32\,a^2\,c^5}\right )-{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (\frac {21\,A}{128\,a^2\,c^5}+\frac {B\,9{}\mathrm {i}}{128\,a^2\,c^5}\right )-{\mathrm {tan}\left (e+f\,x\right )}^5\,\left (-\frac {27\,B}{128\,a^2\,c^5}+\frac {A\,63{}\mathrm {i}}{128\,a^2\,c^5}\right )+{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {469\,A}{640\,a^2\,c^5}+\frac {B\,201{}\mathrm {i}}{640\,a^2\,c^5}\right )+\frac {11\,A}{40\,a^2\,c^5}-\frac {B\,1{}\mathrm {i}}{40\,a^2\,c^5}}{f\,\left (-{\mathrm {tan}\left (e+f\,x\right )}^7-{\mathrm {tan}\left (e+f\,x\right )}^6\,3{}\mathrm {i}+{\mathrm {tan}\left (e+f\,x\right )}^5-{\mathrm {tan}\left (e+f\,x\right )}^4\,5{}\mathrm {i}+5\,{\mathrm {tan}\left (e+f\,x\right )}^3-{\mathrm {tan}\left (e+f\,x\right )}^2\,1{}\mathrm {i}+3\,\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )}+\frac {3\,x\,\left (7\,A+B\,3{}\mathrm {i}\right )}{128\,a^2\,c^5} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________